package com.gec.zhs.controller;

import java.util.List;

import com.gec.zhs.entity.query.BuildertablecolumnQuery;
import com.gec.zhs.entity.po.Buildertablecolumn;
import com.gec.zhs.entity.vo.ResponseVO;
import com.gec.zhs.service.BuildertablecolumnService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 代码生成器的字段信息 Controller
 */
@RestController("buildertablecolumnController")
@RequestMapping("/buildertablecolumn")
public class BuildertablecolumnController extends ABaseController{

	@Resource
	private BuildertablecolumnService buildertablecolumnService;
	/**
	 * 根据条件分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(BuildertablecolumnQuery query){
		return getSuccessResponseVO(buildertablecolumnService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(Buildertablecolumn bean) {
		buildertablecolumnService.add(bean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<Buildertablecolumn> listBean) {
		buildertablecolumnService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增/修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVO addOrUpdateBatch(@RequestBody List<Buildertablecolumn> listBean) {
		buildertablecolumnService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id查询对象
	 */
	@RequestMapping("/getBuildertablecolumnById")
	public ResponseVO getBuildertablecolumnById(String id) {
		return getSuccessResponseVO(buildertablecolumnService.getBuildertablecolumnById(id));
	}

	/**
	 * 根据Id修改对象
	 */
	@RequestMapping("/updateBuildertablecolumnById")
	public ResponseVO updateBuildertablecolumnById(Buildertablecolumn bean,String id) {
		buildertablecolumnService.updateBuildertablecolumnById(bean,id);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id删除
	 */
	@RequestMapping("/deleteBuildertablecolumnById")
	public ResponseVO deleteBuildertablecolumnById(String id) {
		buildertablecolumnService.deleteBuildertablecolumnById(id);
		return getSuccessResponseVO(null);
	}
}